//https://leetcode.cn/problems/missing-number/
class Solution {
    public int missingNumber(int[] nums) {
        //哈希表
        int len = nums.length;
        int[] hash = new int[len+1];
        for(int i = 0; i < len; i++) hash[nums[i]]++;
        for(int i = 0; i < len+1; i++) 
            if(hash[i] == 0) return i;
        return -1;
    }
}